package zzzhc.http;

import org.apache.commons.httpclient.protocol.Protocol;
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;

public final class HttpUtil {

	private HttpUtil() {
	}

	public static void enableHttps() {
		java.security.Security
				.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
		System.setProperty("java.protocol.handler.pkgs",
				"com.sun.net.ssl.internal.www.protocol");
		Protocol
				.registerProtocol(
						"https",
						new Protocol(
								"https",
								(ProtocolSocketFactory) new EasySSLProtocolSocketFactory(),
								443));
	}
}
